Skip to content

Quickfix#83

Merged
Hendrik-code merged 4 commits into
mainfrom
quickfix
Jun 11, 2025
Merged

Quickfix#83
Hendrik-code merged 4 commits into
mainfrom
quickfix

Conversation

@Hendrik-code

Copy link
Copy Markdown
Owner

No description provided.

@Hendrik-code Hendrik-code requested a review from Copilot April 28, 2025 07:12
@Hendrik-code Hendrik-code self-assigned this Apr 28, 2025
@Hendrik-code Hendrik-code added the bug Something isn't working label Apr 28, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR “Quickfix” makes two key changes to improve segmentation handling and shape consistency.

  • In TPTBox/core/poi.py, the cropping applied to the subregion mask is removed (now commented out) to rely solely on the crop computed from vert_msk.
  • In TPTBox/core/nii_wrapper.py, an assertion is added to enforce that the filtered connected components array retains the expected shape, and the extraction of labels now explicitly uses get_array().

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
TPTBox/core/poi.py Removed subregion cropping by commenting out its compute_crop(maximum_size=…) call.
TPTBox/core/nii_wrapper.py Added an assertion to verify shape consistency and updated label extraction logic.
Comments suppressed due to low confidence (3)

TPTBox/core/poi.py:1069

  • Commenting out the subregion mask cropping may affect the alignment between vert_msk and subreg_msk; please verify that the resulting crop is appropriate for both.
# crop = subreg_msk.compute_crop(maximum_size=crop)

TPTBox/core/nii_wrapper.py:1258

  • The new assertion enforces shape consistency after filtering; please confirm that all segmentation use cases produce an array with the expected shape to avoid runtime errors.
assert arr.shape == self.shape, f"Shape mismatch: {arr.shape} != {self.shape}"

TPTBox/core/nii_wrapper.py:1264

  • Using get_array() on the extracted label ensures proper array extraction for label preservation; please verify that this aligns with the intended behavior for all segmentation masks.
s = self.extract_label(old_labels,keep_label=True).get_array()

@Hendrik-code Hendrik-code requested a review from robert-graf June 11, 2025 07:48
@Hendrik-code Hendrik-code merged commit 8f438d7 into main Jun 11, 2025
2 checks passed
@Hendrik-code Hendrik-code deleted the quickfix branch June 11, 2025 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants